﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DapperExtensions.Mapper;

namespace ZLWeb.WebApiEntity.EasyUse
{
    public class WalletInfo
    {
        private string _accname = string.Empty;
        private string _accsrcbrname = string.Empty;
        private string _accskbrname = string.Empty;
        private string _accskppname = string.Empty;
        private DateTime? _acchbbegdate = DateTime.Now;
        private DateTime? _acchbenddate = DateTime.Now;

        /// <summary>
        ///  账户显示名称
        /// </summary>
        public string Accname
        {
            get { return _accname; }
            set { _accname = value; }
        }

        /// <summary>
        ///  钱包id（也作为消费顺序（退消费→红包→钱包id））
        /// </summary>
        public decimal Accwid { get; set; }

        /// <summary>
        ///  钱包类型：1-红包（不显示在余额中，仅进行详细查询时显示）
        /// </summary>
        public short Accwtype { get; set; }

        /// <summary>
        ///  来源门店id（钱包生效地点，如取门店，余额调整：调整地点）
        /// </summary>
        public int Accsrcbrid { get; set; }

        /// <summary>
        ///  来源门店名称
        /// </summary>
        public string Accsrcbrname
        {
            get { return _accsrcbrname; }
            set { _accsrcbrname = value; }
        }

        /// <summary>
        ///  收款营业日
        /// </summary>
        public DateTime? Accskyydate { get; set; }

        /// <summary>
        ///  收款门店id（收款核算对象id）(余额调整：虚拟机构)
        /// </summary>
        public int Accskbrid { get; set; }

        /// <summary>
        ///  收款门店名称
        /// </summary>
        public string Accskbrname
        {
            get { return _accskbrname; }
            set { _accskbrname = value; }
        }

        /// <summary>
        ///  收款品牌id
        /// </summary>
        public int Accskppid { get; set; }

        /// <summary>
        ///  收款品牌名称
        /// </summary>
        public string Accskppname
        {
            get { return _accskppname; }
            set { _accskppname = value; }
        }

        /// <summary>
        ///  红包增值钱包开始使用日期
        /// </summary>
        public DateTime? Acchbbegdate
        {
            get { return _acchbbegdate; }
            set { _acchbbegdate = value; }
        }

        /// <summary>
        ///  红包增值钱包截止使用+B6+E97
        /// </summary>
        public DateTime? Acchbenddate
        {
            get { return _acchbenddate; }
            set { _acchbenddate = value; }
        }

        /// <summary>
        ///  充值入：现金金额
        /// </summary>
        public decimal Accincashmy { get; set; }

        /// <summary>
        ///  充值入：增值金额
        /// </summary>
        public decimal Accinaddmy { get; set; }

        /// <summary>
        ///  累积出：现金金额
        /// </summary>
        public decimal Accoutcashmy { get; set; }

        /// <summary>
        ///  累积出：增值金额
        /// </summary>
        public decimal Accoutaddmy { get; set; }

        /// <summary>
        ///  计余额：现金金额（充值入-累计出）
        /// </summary>
        public decimal Acccashbalance { get; set; }

        /// <summary>
        ///  计余额：增值金额（充值入-累计出）
        /// </summary>
        public decimal Accaddbalance { get; set; }

    }

    public class WalletInfoMapper : ClassMapper<WalletInfo>
    {
        public WalletInfoMapper()
        {
            Table("#WalletInfo");
            Map(f => f.Accname).Column("accname");
            Map(f => f.Accwid).Column("accwid");
            Map(f => f.Accwtype).Column("accwtype");
            Map(f => f.Accsrcbrid).Column("accsrcbrid");
            Map(f => f.Accsrcbrname).Column("accsrcbrname");
            Map(f => f.Accskyydate).Column("accskyydate");
            Map(f => f.Accskbrid).Column("accskbrid");
            Map(f => f.Accskbrname).Column("accskbrname");
            Map(f => f.Accskppid).Column("accskppid");
            Map(f => f.Accskppname).Column("accskppname");
            Map(f => f.Acchbbegdate).Column("acchbbegdate");
            Map(f => f.Acchbenddate).Column("acchbenddate");
            Map(f => f.Accincashmy).Column("accincashmy");
            Map(f => f.Accinaddmy).Column("accinaddmy");
            Map(f => f.Accoutcashmy).Column("accoutcashmy");
            Map(f => f.Accoutaddmy).Column("accoutaddmy");
            Map(f => f.Acccashbalance).Column("acccashbalance");
            Map(f => f.Accaddbalance).Column("accaddbalance");
        }
    }
}
